package com.qls.web.modules.op.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qls.core.entity.OpGroup;
import com.qls.web.common.utils.PageUtils;
import com.qls.web.common.utils.Query;
import com.qls.web.modules.op.dao.GroupDao;
import com.qls.web.modules.op.service.GroupService;
import com.qls.web.modules.vo.GroupVO;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * @author doyoung
 */
@Service("groupService")
public class GroupServiceImpl extends ServiceImpl<GroupDao, OpGroup> implements GroupService {


    @Override
    public OpGroup queryStoreIdById(Integer id) {
        return baseMapper.queryStoreIdById(id);
    }

    @Override
    public PageUtils sqlQueryPage(Map<String, Object> params) {
        IPage<GroupVO> page = new Query<GroupVO>().getPage(params);
        params.put("page", page);
        List<GroupVO> list = baseMapper.sqlQueryPage(params);
        return new PageUtils(page, list);
    }

    @Override
    public OpGroup getAll() {
        return baseMapper.getAll();
    }

    @Override
    public List<OpGroup> querygpByStoreId(Map<String, Object> params) {
        IPage<OpGroup> page = new Query<OpGroup>().getPage(params);
        List<OpGroup> list = null;
        params.put("page", page);
        list = baseMapper.querygpByStoreId(params);
        return list;
    }

    @Override
    public List<OpGroup> sqlQuery(Map<String, Object> params) {

        List<OpGroup> list = baseMapper.sqlQuery(params);
        return list;
    }


}